; ORIGINAL: 3dt2.1/examples/gui.scm
; $Id: gui.scm,v 1.4 1997/04/30 20:24:12 jread Exp $
;- gui.scm ------------------------------------------------------
; These examples implement GUI command templates to be used with
; the file cmd.scm.

;    spline generates a prompt asking the user to pick a spline
;    point, and passes the point to curve:spline.
;
;    fillet generates two prompts asking the user to pick two
;    curves to fillet, then passes these curves to the function
;    curve:fillet, along with the argument blend-rad.
;
;    mat-plain-cmd asks the user to pick a list of entities,
;    then passes the list to the function render:material-plain
;    along with the color.
;-----------------------------------------------------------------

(require 'cmd "cmd.scm")

(define (spline)
  (cmd:set `(edge:spline
    ,(arg:desc  %point
       '(ui:prompt "Indicate spline points - press right button when done")
           '(ui:prompt " ")
               #t
                )
             )))


(define (fillet)
  (cmd:set `(edge:fillet
              ,(arg:desc   %pickr '(ui:prompt "Fillet - select first curve")
                           )
              ,(arg:desc   %pickr '(ui:prompt "Fillet - select second curve")
                           )
              blend-rad
              )))


(define (mat-plain-cmd r g b)
  (cmd:set `(entity:set-material
      ,(arg:desc
         %pick
        '(ui:prompt "Plain color : Pick entities - right button when done")
                 #f
                 #t)
			  (let ((m (material)))
				(begin
				  (material:set-color-type m "plain")
				  (material:set-color-prop m "color" (color:rgb ,r ,g ,b))
				  m
				)
			  )
              )))
